import ajax from './ajax'
import md5 from 'js-base64';
let Base64 = require('js-base64').Base64;

/**
 * test http post demo
 * username ----> key
 * password ----> value
 */
export const getPostLogin = (
    username,
    password,
) => ajax.post('/application/login', {
    username:username,
    password:password,
});

//***************************************************application********************************************************
/**
 * 用户进入微信页面，根据code获取accesstoaken拉取微信用户相关信息
 * @param code
 * @returns {AxiosPromise<any>}
 */
export const getAccessToken = (
    code
) => ajax.post('/application/getAccessToken',{
    code: code
});

/**
 * 根据微信用户的openid查询用户信息
 * @param openid
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const loginByOpenId = (
    mobile,openid
) => ajax.post('application/loginByOpenId',{
    mobile: Base64.encode(mobile),
    openid: openid
});

export const getWeiXinConfig4Url = (
    url_val
) => ajax.post('application/getWeiXinConfig4Url',{
    url_val: url_val
});

/**
 * 验证手机号
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const checkMobile = (
    mobile
) => ajax.post('application/checkMobile',{
    mobile: Base64.encode(mobile)
});
/**
 * 注册/激活页面发送验证码
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const captcha = (
    mobile,
) => ajax.post('application/captcha',{
    mobile: Base64.encode(mobile),
});
/**
 * 注册/激活页面第一步
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const registry1 = (
    mobile,captcha,password
) => ajax.post('application/registry',{
    mobile: Base64.encode(mobile),
    captcha: captcha,
    password: Base64.encode(password)

});

/**
 * 注册第二步
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const registry2 = (
    name,province,city,district,inst_uuid,openid,registryFlag
) => ajax.post('application/registry2',{
    name: name,
    province: province,
    city: city,
    district: district,
    inst_uuid: inst_uuid,//所属机构
    openid:openid,
    flag: registryFlag
});


/**
 * 激活第二步
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const activated3 = (
    mobile,name
) => ajax.post('application/activated3',{
    mobile: Base64.encode(mobile),
    name: name,
});


/**
 * 审核没有通过的时候修改资料
 * customerType 客户类型 01 use
 * mobile
 * name
 * bankUuid机构
 * province
 * city
 * district
 */
export const updateRegistInfo = (
    customerType,uuid,mobile,name,bankUuid,province,city,district
) => ajax.post('application/updateRegistInfo',{
    customerType:customerType,
    uuid:uuid,
    mobile: mobile,
    name:name,
    bankUuid:bankUuid,
    province:province,
    city:city,
    district:district,

});
/**
 * 重置密码发送验证码
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const restPWCaptcha = (
    mobile
) => ajax.post('application/restPWCaptcha',{
    mobile: Base64.encode(mobile)
});
/**
 * 忘记密码
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const resetPassword = (
    mobile,captcha,rawPasswd
) => ajax.post('application/resetPassword',{
    mobile: Base64.encode(mobile),
    captcha: captcha,
    rawPasswd: Base64.encode(rawPasswd)
});



/**
 * 用户登出
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const loginout = (
    mobile
) => ajax.post('application/loginout',{
    mobile: mobile
});

/**
 * 注册
 * @param mobile
 * @param captcha
 * @param password
 * @param openid
 * @param name
 * @param inst_uuid
 * @param addr
 * @param province
 * @param city
 * @param district
 * @returns {AxiosPromise<any>}
 */
export const registry = (
    mobile,
    captcha,
    password,
    openid,
    name,
    inst_uuid,
    addr,
    province,
    city,
    district
) => ajax.post('application/registry',{
    mobile: Base64.encode(mobile),
    captcha: captcha,
    password: Base64.encode(password),
    openid: openid,
    name: name,
    inst_uuid: inst_uuid,
    addr: addr,
    province: province,
    city: city,
    district: district
});

/**
 *  登录接口
 * /application/loginCustomer
 * @param mobile
 * @param password
 * @param customerType
 * @param imei
 * @returns {AxiosPromise<any>}
 */
export const loginCustomer = (
    mobile,
    password,
    openid,
) => ajax.post('/application/loginCustomer',{
    mobile:Base64.encode(mobile),
    password:Base64.encode(password),
    openid:openid
});

/**
 * 忘记密码
 * @param mobile
 * @param rawPasswd
 * @param captcha
 * @returns {AxiosPromise<any>}
 */
export const forgetPw = (
    mobile,
    password,
    captcha
) => ajax.post('application/forgetPw',{
    mobile: Base64.encode(mobile),
    password: Base64.encode(password),
    captcha: captcha
});

//***************************************************select*************************************************************

/**
 * 所在单位接口注册使用
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const getAllPartnerInfos = (

) => ajax.post('select/getAllPartnerInfos',{


});
/**
 * 所属机构接口 注册使用
 * @param mobile
 * bankUuid  单位的uuid
 * @returns {AxiosPromise<any>}
 */
export const getInstInfos = (
    bankUuid,province,city,district,

) => ajax.post('select/getInstInfos',{
    bankUuid: bankUuid,
    province: province,
    city: city,
    district: district,

});

/**
 * 获取故障类型
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const showFaultTypeSelect = (
    mobile
) => ajax.post('select/showFaultTypeSelect', {
    mobile: mobile
});

/**
 * 部门
 * uuid  机构uuid
 * @returns {AxiosPromise<any>}
 */
export const getDepartments = (
    uuid,
) => ajax.post('select/getDepartments',{
    uuid: uuid,
});
/**
 * 常用机构列表
 * bankUuid  客户的id
 * latitude longitude 经纬度
 * keyword 搜索的字段
 * @returns {AxiosPromise<any>}
 */
export const showCommonInstSelect = (
    mobile, customerType,
) => ajax.post('select/showCommonInstSelect',{
    mobile:mobile,
    customerType: "01",
});
/**
 * 查询机构网点信息
 * @param mobile
 * @param keyword
 * @param pageNumber
 * @param pageSize
 * @param longitude
 * @param latitude
 * @param bankUuid
 * @returns {AxiosPromise<any>}
 */
export const showInstSelectForUser = (
    mobile,keyword,bankUuid,latitude,longitude,pageNumber,pageSize
) => ajax.post('select/showInstSelectForUser',{
    mobile: mobile,
    keyword: keyword,
    bankUuid: bankUuid,
    latitude: latitude,
    longitude: longitude,
    pageNumber: pageNumber,
    pageSize:pageSize,
});

/**
 * 查询用户对应的服务商(维修单位)列表
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const showServiceProviderForUser = (
    mobile,
) => ajax.post('select/showServiceProviderForUser',{
    mobile: mobile,
});

//********************************************************home****************************************************

/**
 * 首页的展示
 * @param mobile
 * bankUuid 客户编号
 * @returns {AxiosPromise<any>}
 */
export const indexInfo = (
    mobile, bankUuid//本地参数的名字

) => ajax.post('application/indexInfo',{
    mobile: mobile,
    bankUuid: bankUuid,

});

/**
 * 获取该任务下的运维人员信息
 * @param mobile
 * @param uuid
 * @returns {AxiosPromise<any>}
 */
export const getProInfoFromOrder = (
    mobile,uuid
) => ajax.post('home/getProInfoFromOrder',{
    mobile: mobile,
    uuid: uuid
});

/**
 * 评价报修单
 * @param mobile
 * @param uuid              任务uuid
 * @param attitude_score    态度评分 ，整数 2/4/6/8/10 五个等级
 * @param skill_score       技能评分
 * @param speed_score       速度评分
 * @param proUuid           用户uuid
 * @param content
 * @returns {AxiosPromise<any>}
 */
export const sendEvaluate = (
    mobile,uuid,attitude_score,skill_score, speed_score,proUuid,content
) => ajax.post('home/evaluate',{
    mobile: mobile,
    uuid: uuid,
    attitude_score: attitude_score,
    skill_score: skill_score,
    speed_score: speed_score,
    proUuid: proUuid,
    content: content

});

//***************************************************message************************************************************
/**
 *
 * @returns {AxiosPromise<any>}
 */
export const todoList = (
    mobile,
) => ajax.post('message/todoList',{
    mobile: mobile
});

/**
 * 获取未读的消息
 * @returns {AxiosPromise<any>}
 */

export const getNewMessageCount = (
    mobile,
) => ajax.post('message/getNewMessageCount',{
    mobile: mobile,
});
/**
 * 系统消息
 * @returns {AxiosPromise<any>}
 *  @param pageNumber
 * @param pageSize
 */

export const showSystemNotify = (
    mobile,pageNumber,pageSize
) => ajax.post('message/showSystemNotify',{
    mobile: mobile,
    pageNumber:pageNumber,
    pageSize:pageSize,

});


//**************************************************warninglist*********************************************************

/**
 * 报修单详情
 * @param mobile
 * @param warningUuid
 * @returns {AxiosPromise<any>}
 */
export const orderContent = (
    mobile,
    warningUuid,
) => ajax.post('warninglist/orderContent',{
    mobile: mobile,
    warningUuid: warningUuid,
});

/**
 * 报修单进度
 * @param mobile
 * @param warningUuid
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const orderStateFlow = (
    mobile,
    warningUuid,
    pageNumber,
    pageSize,
) => ajax.post('warninglist/orderStateFlow',{
    mobile:mobile,
    warningUuid:warningUuid,
    pageNumber:pageNumber,
    pageSize:pageSize,
});

/**
 * 回复留言板
 * @param mobile
 * @param warningUuid
 * @param pageType 默认0
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const orderMessageBoard = (
    mobile, warningUuid, pageType, pageNumber, pageSize
) => ajax.post('warninglist/orderMessageBoard',{
    mobile:mobile,
    warningUuid:warningUuid,
    pageType:pageType,
    pageNumber:pageNumber,
    pageSize:pageSize,
});

/**
 * 录入维修单
 * @param mobile
 * @param warningUuid
 * @returns {AxiosPromise<any>}
 */
export const orderContentByUser = (
    mobile,warningUuid
) => ajax.post('warninglist/orderContentByUser',{
    mobile:mobile,
    warningUuid:warningUuid,
});

//********************************************************inspection****************************************************

/**
 * 查看巡检报告-概览
 * @param mobile
 * @param uuid
 * @returns {AxiosPromise<any>}
 */
export const getReportSummary = (
    mobile,
    uuid,
) => ajax.post('inspection/getReportSummary',{
    mobile: mobile,
    uuid: uuid,
});

/**
 * 巡检单操作历史
 * @param mobile
 * @param uuid
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const pagedOperations = (
    mobile,uuid,pageNumber,pageSize
) => ajax.post('inspection/pagedOperations',{
    mobile: mobile,
    uuid: uuid,
    pageNumber:pageNumber,
    pageSize:pageSize,
});

/**
 * 巡检单报告异常汇总
 * uuid	巡检单uuid
 * @param mobile
 * @param uuid
 * @returns {AxiosPromise<any>}
 */
export const getExceptionReport = (
    mobile,uuid
) => ajax.post('inspection/getExceptionReport',{
    mobile: mobile,
    uuid: uuid,
});

/**
 * 查看巡检报告-按类别
 * uuid	巡检单uuid
 * item_uuid	巡检项uuid	FWQ, JFHJ 等
 * @param mobile
 * @param uuid
 * @param item_uuid
 * @returns {AxiosPromise<any>}
 */
export const getSubReport = (
    mobile,uuid,item_uuid
) => ajax.post('inspection/getSubReport',{
    mobile: mobile,
    uuid: uuid,
    item_uuid:item_uuid
});
//***************************************************center*************************************************************

/**
 * 修改部门
 * uuid	部门uuid

 * @returns {AxiosPromise<any>}
 */
export const modifybumenInfo = (
    mobile,uuid
) => ajax.post('reviseaccount/modifyInstInfo',{
    mobile: mobile,
    uuid: uuid,
});
/**
 * 修改机构
 * uuid  机构的uuid
 * latitude	机构的填写
 * longitude 机构的填写
 */
export const modifyInstInfo = (
    mobile,uuid,latitude,longitude,
) => ajax.post('reviseaccount/modifyInstInfo',{
    mobile: mobile,
    uuid: uuid,
    latitude: latitude,
    longitude:longitude,
});
/**
 * 修改头像
 * headImg  头像url

 * @returns {AxiosPromise<any>}
 */
export const saveHeadImg = (
    mobile,
    headImg,
) => ajax.post('reviseaccount/saveHeadImg',{
    mobile: mobile,
    headImg: headImg,
});
/**
 * 修改手机号
 * uuid  用户ID
 * password	密码 base64加密
 * mobile 新手机号 base64加密
 * captcha 验证码
 * @returns {AxiosPromise<any>}
 */
export const mobileCheckPwd = (
    uuid,password,mobile,captcha
) => ajax.post('reviseaccount/mobileCheckPwd',{
    uuid: uuid,
    password: Base64.encode(password),
    mobile: mobile,
    captcha:captcha,
});
/**
 * 修改密码
 * uuid  用户uuid
 * password 老密码 base64加密
 * rawPasswd 新密码 base64加密

 * @returns {AxiosPromise<any>}
 */
export const revisePassword = (
    mobile,
    uuid,password,rawPasswd,
) => ajax.post('reviseaccount/revisePassword',{
    mobile: mobile,
    uuid: uuid,
    password: Base64.encode(password),
    rawPasswd: Base64.encode(rawPasswd),
});

/**修改联系方式
 *
 * contact_number  联系方式

 * @returns {AxiosPromise<any>}
 */
 export const saveContactNumber = (
    mobile,
    contact_number,
) => ajax.post('reviseaccount/saveContactNumber',{
    mobile: mobile,
    contact_number: contact_number,

});

/**
 * 巡检单确认
 * @param mobile
 * @param uuid
 * @returns {AxiosPromise<any>}
 */
export const inspectionConfirm = (
    mobile,uuid
) => ajax.post('inspection/confirm',{
    mobile: mobile,
    uuid:uuid
});

/**
 * 巡检单退回
 * @param mobile
 * @param uuid
 * @returns {AxiosPromise<any>}
 */
export const inspectionReject = (
    mobile,uuid
) => ajax.post('inspection/reject',{
    mobile: mobile,
    uuid: uuid
});


//********************************************************purchase****************************************************

/**
 * 配件更换
 * 订单详情-单个采购单
 * @param mobile
 * @param purchase_uuid
 * @returns {AxiosPromise<any>}
 */
export const purchaseList = (
    mobile,purchase_uuid
) => ajax.post('purchase/list',{
    mobile: mobile,
    purchase_uuid: purchase_uuid,
});

/**
 * 配件更换
 * 订单详情-展示所有采购单数据
 * @param mobile
 * @param warning_uuid
 * @param state
 * @returns {AxiosPromise<any>}
 */
export const purchaseAllFlatten = (
    mobile,warning_uuid,state
) => ajax.post('purchase/listAllFlatten',{
    mobile: mobile,
    warning_uuid: warning_uuid,
    state: state
});

/**
 * 确认(拒绝)采购单
 * @param mobile
 * @param purchase_uuid
 * @param warning_uuid
 * @param confirm y - 确认 n - 拒绝 其他 - 无效值
 * @returns {AxiosPromise<any>}
 */
export const purchaseConfirm = (
    mobile,purchase_uuid,warning_uuid,confirm
) => ajax.post('purchase/confirm',{
    mobile: mobile,
    purchase_uuid: purchase_uuid,
    warning_uuid: warning_uuid,
    confirm: confirm
});

//********************************************************machine****************************************************

/**
 * 设备详情
 * equipUuid	String	二选一	设备唯一标识
 * equipCode	String	二选一	设备编码
 * @param mobile
 * @param equipUuid
 * @returns {AxiosPromise<any>}
 */
export const machineUuidDetails = (
    mobile,equipUuid
) => ajax.post('machine/details',{
    mobile: mobile,
    equipUuid: equipUuid
});

/**
 * 设备详情
 * equipUuid	String	二选一	设备唯一标识
 * equipCode	String	二选一	设备编码
 * @param mobile
 * @param equipUuid
 * @returns {AxiosPromise<any>}
 */
export const machineCodeDetails = (
    mobile,equipCode,equipUuid,
) => ajax.post('machine/details',{
    mobile: mobile,
    equipCode: equipCode,
    equipUuid:equipUuid,
});
/**
 * 关联设备
 * orderUuid 报修单id
 * machineUuid	String 设备id
 * @returns {AxiosPromise<any>}
 */
export const machinemachineLink = (
    mobile,orderUuid,machineUuid,
) => ajax.post('machine/machineLink',{
    mobile: mobile,
    orderUuid: orderUuid,
    machineUuid:machineUuid,
});

//********************************************************identity****************************************************
/**
 * 根据二维码查询用户信息
 * @param mobile
 * @param qrCode
 * @returns {AxiosPromise<any>}
 */
export const checkQrCode = (
    mobile,qrCode
) => ajax.post('identity/checkQrCode',{
    mobile: mobile,
    qrCode: qrCode
});

//********************************************************warning****************************************************

/**
 * 发起报修单
 * @param mobile
 * @param instUuid
 * @param machineUuid
 * @param faultTypeUuid
 * @param describe
 * @param image
 * @returns {AxiosPromise<any>}
 */
export const orderApply = (
    mobile,instUuid,machineUuid,faultTypeUuid,describe,image
) => ajax.post('warning/orderApply',{
    mobile: mobile,
    instUuid:instUuid,
    machineUuid:machineUuid,
    faultTypeUuid:faultTypeUuid,
    describe:describe,
    image:image
});

/**
 * 设备维修记录
 *  machineUuid 设备的id
 *
 * @returns {AxiosPromise<any>}
 */

export const machineRepairList = (
    mobile,machineUuid,pageNumber, pageSize,
) => ajax.post('warninglist/machineRepairList',{
    mobile: mobile,
    machineUuid:machineUuid,
    pageNumber:pageNumber,
    pageSize:pageSize,
});

/**
 * 抄送报修单（userAPP）
 * @param mobile
 * @param warningUuid
 * @param ccList
 * @returns {AxiosPromise<any>}
 */
export const orderCC = (
    mobile,warningUuid,ccList
) => ajax.post('warning/orderCC',{
    mobile: mobile,
    warningUuid: warningUuid,
    ccList: ccList,
});

//********************************************************voucher****************************************************

/**
 * 凭证类型
 *  partnerUuid 客户的id
 *
 */
export const vouchertype = (
    mobile,partnerUuid,
) => ajax.post('voucher/type',{
    mobile: mobile,
    partnerUuid:partnerUuid,

});
/**
 * 凭证列表
 *  partnerUuid 客户的id
 *  typeUuid 类型
 *  name 搜索字
 */
export const voucherlist = (
    mobile,partnerUuid,pageNumber,pageSize,typeUuid,name,
) => ajax.post('voucher/list',{
    mobile: mobile,
    partnerUuid:partnerUuid,
    pageNumber:pageNumber,
    pageSize:pageSize,
    typeUuid:typeUuid,
    name:name,

});
/**
 * 凭证最近搜索记录
 */
export const voucherrecentSearch = (
    mobile
) => ajax.post('voucher/recentSearch',{
    mobile: mobile,
});
/**
 * 凭证删除最近搜索记录
 */
export const voucherdeleteHistory = (
    mobile,
) => ajax.post('voucher/list',{
    mobile: mobile,
});
/**
 * 凭证下单信息
 * applierUuid 个人的id
 * instUuid 机构的id
 * deptUuid部门的id
 * contactNumber 联系电话
 * addr 地址
 * room房间号
 * remark 备注信息
 * vouchers 凭证请领的数据 json{amounts 件数 description name price supplierUuid typeName uuid}

 */
export const voucherapply = (
    mobile,applierUuid,instUuid,deptUuid,contactNumber,addr,room,remark,vouchers,
) => ajax.post('voucher/apply',{
    mobile: mobile,
    applierUuid:applierUuid,
    instUuid:instUuid,
    deptUuid:deptUuid,
    contactNumber:contactNumber,
    addr:addr,
    room:room,
    remark:remark,
    vouchers:vouchers,

});


/**
 * 凭证申领详情
 *  applicationUuid  数据的id
 */

export const voucherapplyDetails = (
    mobile,applicationUuid,
) => ajax.post('voucher/applyDetails',{
    mobile: mobile,
    applicationUuid:applicationUuid,
});
/**
 * 凭证进度
 *  applicationUuid  数据的id
 */
export const voucherprogressList = (
    mobile,uuid,
) => ajax.post('voucher/progressList',{
    mobile: mobile,
    uuid:uuid,
});

/**
 *  凭证确认签收
 *  applicationUuid 单子号
 *  confirmedVouchers 数组（confirmAmounts 数量 uuid id）json
 *  images 图片的url
 *  description 描述
 */
export const voucherreceive = (
    mobile,applicationUuid,confirmedVouchers,images,description
) => ajax.post('voucher/receive',{
    mobile: mobile,
    applicationUuid:applicationUuid,
    confirmedVouchers:confirmedVouchers,
    images:images,
    description:description,
});


/**
 * 凭证请领服务评价
 * voucherevaluate
 *  applicationUuid 数据的id
 *   quality质量
 *  speed 速度
 *  altitude 服务态度
 */
export const voucherevaluate = (
    mobile,applicationUuid,quality,speed,altitude,content,
) => ajax.post('voucher/evaluate',{
    mobile: mobile,
    applicationUuid:applicationUuid,
    quality:quality,
    speed:speed,
    altitude:altitude,
    content:content,
});

//********************************************************offcie****************************************************

/**
 * 办公用品类型
 *  partnerUuid 客户id
 */
export const commoditytype = (
    mobile,partnerUuid,
) => ajax.post('commodity/type',{
    mobile: mobile,
    partnerUuid:partnerUuid,
});

/**
 * 办公用品列表
 *  partnerUuid 客户的id
 *  name 搜索关键字
 */
export const commoditylist = (
    mobile,partnerUuid,pageNumber,pageSize,typeUuid,name,
) => ajax.post('commodity/list',{
    mobile: mobile,
    partnerUuid:partnerUuid,
    pageNumber:pageNumber,
    pageSize:pageSize,
    typeUuid:typeUuid,
    name:name,

});
/**
 * 办公用品物品的详情
 *  uuid 数据的id
 */
export const commoditydetails = (
    mobile,uuid,
) => ajax.post('commodity/details',{
    mobile: mobile,
    uuid:uuid,
});
/**
 * 办公用品审核人员
 *  partnerUuid 客户的id
 */
export const commodityApprover = (
    mobile,partnerUuid,
) => ajax.post('order/commodityApprover',{
    mobile: mobile,
    partnerUuid:partnerUuid,
});
/**
 * 办公用品提交数据
 *  applierUuid 个人的id
  * instUuid 机构的id
* deptUuid部门的id
* contactNumber 联系电话
* addr 地址
* room房间号
* remark 备注信息
* commodities 办公用品的数据 json{description uuid supplierUuid brand amounts}
 * approvers 审核人的ID 逗号分隔
 * operator 经办人的id
 */
export const orderapply = (
    mobile,applierUuid,instUuid,deptUuid,contactNumber,addr,room,remark,commodities,approvers,operator,
) => ajax.post('order/apply',{
    mobile: mobile,
    applierUuid:applierUuid,
    instUuid:instUuid,
    deptUuid:deptUuid,
    contactNumber:contactNumber,
    addr:addr,
    room:room,
    remark:remark,
    commodities:commodities,
    approvers:approvers,
    operator:operator,

});

/**
 * 办公用品详情页面
 *  orderUuid 单子的id
 */
export const orderDetails = (
    mobile,orderUuid,
) => ajax.post('order/orderDetails',{
    mobile: mobile,
    orderUuid:orderUuid,
});
/**
 * 办公用品进度页
 *  orderUuid 单子的id
 *  pageNumber,pageSize
 */
export const orderprogressing = (
    mobile,orderUuid,pageNumber,pageSize
) => ajax.post('order/progressing',{
    mobile: mobile,
    orderUuid:orderUuid,
    pageNumber:pageNumber,
    pageSize:pageSize
});

/**
 * 办公用品撤销
 *  orderUuid 单子的id
 */
export const ordercancel = (
    mobile,orderUuid,
) => ajax.post('order/cancel',{
    mobile: mobile,
    orderUuid:orderUuid,
});
/**
 * 办公用品确认收货
 *  orderUuid 单子的id
 *  confirmedCommodities json {amounts uuid}
 */
export const orderreceive = (
    mobile,orderUuid,confirmedCommodities,description,images
) => ajax.post('order/receive',{
    mobile: mobile,
    orderUuid:orderUuid,
    confirmedCommodities:confirmedCommodities,
    description:description,
    images:images,
});

/**
 * 办公用品评价
 *  orderUuid 单子的id
 *  quality质量
 *  speed 速度
 *  altitude 服务态度
 */
export const orderevaluate = (
    mobile,orderUuid,quality,speed,altitude,content,

) => ajax.post('order/evaluate',{
    mobile: mobile,
    orderUuid:orderUuid,
    quality:quality,
    speed:speed,
    altitude:altitude,
    content:content,

});

/**
 * 审批意见 同意
 *  orderUuid 单子的id
 *  content 输入你内容
 */
export const orderaccept = (
    mobile,orderUuid,content,
) => ajax.post('order/accept',{
    mobile: mobile,
    orderUuid:orderUuid,
    content:content,

});


/**
 * 审批意见 拒绝
 *  orderUuid 单子的id
 *  content 输入你内容

 */
export const orderrefuse = (
    mobile,orderUuid,content,
) => ajax.post('order/refuse',{
    mobile: mobile,
    orderUuid:orderUuid,
    content:content,

});
/**
 * 经办
 *  orderUuid 单子的id
 *  content 输入你内容
 */
export const orderoperateRefuse = (
    mobile,orderUuid,content,
) => ajax.post('order/operateRefuse',{
    mobile: mobile,
    orderUuid:orderUuid,
    content:content,

});

/**
 * 经办 立即处理
 *  orderUuid 单子的id
 */
export const orderoperateNow = (
    mobile,orderUuid,content,
) => ajax.post('order/operateNow',{
    mobile: mobile,
    orderUuid:orderUuid,
    content:content,

});




/**
/**
 * 发送留言
 * @param mobile
 * @param orderUuid
 * @param describe
 * @param image
 * @returns {AxiosPromise<any>}
 */
export const sendOrderMessageBoard = (
    mobile,orderUuid,describe,image
) => ajax.post('warning/orderMessageBoard',{
    mobile: mobile,
    orderUuid: orderUuid,
    describe: describe,
    image: image
});

/**
 * 取消本次报修
 * @param mobile
 * @param orderUuid
 * @returns {AxiosPromise<any>}
 */
export const orderCancel = (
    mobile,orderUuid
) => ajax.post('warning/orderCancel',{
    mobile: mobile,
    orderUuid: orderUuid
});

/**
 * 关闭报修单
 * @param mobile
 * @param warningUuid
 * @returns {AxiosPromise<any>}
 */
export const closeByUser = (
    mobile,warningUuid
) => ajax.post('warning/closeByUser',{
    mobile: mobile,
    warningUuid: warningUuid
});


/**
 * 发起录入维修单报修
 * @param mobile
 * @param proName 运维人员名称
 * @param provider_uuid 维修机构Id
 * @param instUuid 报修机构Id
 * @param machineUuid 机器Id
 * @param faultTypeUuid 故障类型Id
 * @param urgentLevel 紧急程度Id
 * @param describe 故障描述内容
 * @param image 图片地址
 * @param date1 报修日期
 * @param date2 维修人员到达日期
 * @param date3 故障修复日期
 * @param time1 报修时间
 * @param time2 维修人员到达时间
 * @param time3 故障修复时间
 * @param ccList 抄送
 * @param remark 备注
 * @param ccList 抄送人员
 * @returns {AxiosPromise<any>}
 */
export const orderApplyByUser = (
    mobile,proName,provider_uuid,instUuid,machineUuid,
    faultTypeUuid,urgentLevel,describe,image,date1,date2,
    date3,time1,time2,time3,ccList,remark
) => ajax.post('warning/orderApplyByUser',{
    mobile: mobile,
    proName: proName,
    provider_uuid: provider_uuid,
    instUuid: instUuid,
    machineUuid: machineUuid,
    faultTypeUuid: faultTypeUuid,
    urgentLevel: urgentLevel,
    describe: describe,
    image: image,
    date1: date1,
    date2: date2,
    date3: date3,
    time1: time1,
    time2: time2,
    time3: time3,
    ccList: ccList,
    remark: remark,
});

/**
 * 更新报修
 * @param mobile
 * @param warningUuid
 * @param proName
 * @param provider_uuid
 * @param instUuid
 * @param machineUuid
 * @param faultTypeUuid
 * @param urgentLevel
 * @param describe
 * @param image
 * @param date1
 * @param date2
 * @param date3
 * @param time1
 * @param time2
 * @param time3
 * @param ccList
 * @param remark
 * @returns {AxiosPromise<any>}
 */
export const launchApplyUpdateByUser = (
    mobile,warningUuid,proName,provider_uuid,instUuid,machineUuid,
    faultTypeUuid,urgentLevel,describe,image,date1,date2,
    date3,time1,time2,time3,ccList,remark
) => ajax.post('warning/orderApplyByUser',{
    mobile: mobile,
    warningUuid: warningUuid,
    proName: proName,
    provider_uuid: provider_uuid,
    instUuid: instUuid,
    machineUuid: machineUuid,
    faultTypeUuid: faultTypeUuid,
    urgentLevel: urgentLevel,
    describe: describe,
    image: image,
    date1: date1,
    date2: date2,
    date3: date3,
    time1: time1,
    time2: time2,
    time3: time3,
    ccList: ccList,
    remark: remark
});

/**
 * 用户归档录入报修单
 * @param mobile
 * @param warningUuid
 * @returns {AxiosPromise<any>}
 */
export const orderArchive = (
    mobile,warningUuid
) => ajax.post('warning/orderArchive',{
    mobile: mobile,
    warningUuid: warningUuid,
});


//********************************************************customer****************************************************

/**
 * User是否可以随时关闭报修单
 * "can": "1" // "1" - 可以，其他 - 不行。
 * @param mobile
 * @returns {AxiosPromise<any>}
 */
export const canCloseWarningOrder = (
    mobile,
) => ajax.post('customer/canCloseWarningOrder',{
    mobile: mobile
});

/**
 * 查询待抄送的银行人员 customer/findCCList
 * @param mobile
 * @param keyword
 * @param warningUuid
 * @returns {AxiosPromise<any>}
 */
export const findCCList = (
    mobile,keyword,warningUuid
) => ajax.post('customer/findCCList',{
    mobile: mobile,
    keyword: keyword,
    warningUuid: warningUuid,
});

//********************************************************file****************************************************

/**
 * 上传图片到七牛云：获取到serverIds之后调用/file/upload
 * @param mobile
 * @param serverIds
 * @returns {AxiosPromise<any>}
 */
export const uploadQiNiuImage = (
    mobile,serverIds,openid
) => ajax.post('file/upload',{
    mobile: mobile,
    serverIds: serverIds,
    openid: openid
});

//********************************************************history*******************************************************
/**
 * 设备报修历史
 * @param mobile
 * @param type
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const warningHistory = (
    mobile,type,pageNumber,pageSize
) => ajax.post('history/warning',{
    mobile: mobile,
    type: type,
    pageNumber: pageNumber,
    pageSize: pageSize
});

/**
 * 抄送历史
 * @param mobile
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const warningCCToMe = (
    mobile,pageNumber,pageSize
) => ajax.post('history/warningCCToMe',{
    mobile: mobile,
    pageNumber: pageNumber,
    pageSize: pageSize
});

/**
 * 场地巡检历史
 * @param mobile
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const inspectionHistory = (
    mobile,pageNumber,pageSize
) => ajax.post('history/inspection',{
    mobile: mobile,
    pageNumber: pageNumber,
    pageSize: pageSize
});

/**
 * 办公用品历史
 * @param mobile
 * @param type
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const commodityHistory = (
    mobile,type,pageNumber,pageSize
) => ajax.post('history/commodity',{
    mobile: mobile,
    type: type,
    pageNumber: pageNumber,
    pageSize: pageSize
});

/**
 * 凭证请领历史
 * @param mobile
 * @param pageNumber
 * @param pageSize
 * @returns {AxiosPromise<any>}
 */
export const voucherHistory = (
    mobile,pageNumber,pageSize
) => ajax.post('history/voucher',{
    mobile: mobile,
    pageNumber: pageNumber,
    pageSize: pageSize
});


//********************************************************location****************************************************

/**
 * 获取运维人员位置
 * @param proUuid
 * @returns {AxiosPromise<any>}
 */
export const getProLocation = (
    proUuid
) => ajax.post('location/getProLocation',{
    proUuid: proUuid
});